package com.qianke.domain.enums;

public enum AdminRuleTypeEnum {

    URL(1, "url"),
    MENU(2, "菜单");

    AdminRuleTypeEnum(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    private Integer code;
    private String text;

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static AdminRuleTypeEnum fromCode(Integer code) {
        for (AdminRuleTypeEnum oneZeroEnum : AdminRuleTypeEnum.values()) {
            if (oneZeroEnum.getCode().equals(code)) {
                return oneZeroEnum;
            }
        }
        return null;
    }
}
